QuickOPC User's Guide and Reference
Result Objects
Fundamentals > Components and Objects > Helper Types > Result Objects

Result objects are returned by methods that work on multiple elements simultaneously such as EasyDAClient.ReadMultipleItems, or EasyUAClient.ReadMultiple. Such methods return an array of OperationResult objects, or an array of objects derived from OperationResult. This approach is chosen, among other reasons, because the method cannot throw an exception if an operation on a single element fails (as operations on other elements might have succeeded).

Each OperationResult has an Exception property, which indicates the outcome of the operation. If the Exception is a null reference, the operation has completed successfully. There is also a State property, which contains user-defined information that you have passed to the method.

The objects derived from OperationResult have additional properties, which contain the actual results in case the operation was successful. Such objects are e.g. ValueResult (contains a data value), DAVtqResult (contains value, timestamp, and quality combination for OPC “Classic”), or UAAttributeDataResult (contains value, timestamps, and status code combination for OPC-UA).

The OperationResult object (and therefore all result objects derived from it as well) has a Diagnostics property, which contains a collection of warning and informational diagnostics entries gathered, performing the requested operation. You can use this collection to retrieve additional information about the outcome of the operation.

The additional OperationResult.DiagnosticsSummary string contains a textual summary of diagnostics information, one message per line.

Note that diagnostics information in the OperationResult is gathered and available both in case of success, and in case of a failure.

Currently, the diagnostics information is only available for operations on OPC Unified Architecture (OPC-UA), i.e. not for OPC “Classic”.

See Also